#include<iostream>
using namespace std;
int main(){
    int a,b;
    while(cin>>a>>b){
        if(a>b)
        {
            int temp=a;
            a=b;
            b=temp;
        }
        int even=0,odd=0;
        for(int i=a;i<=b;i++){
            if(i%2==0){
                even+=i*i;
            }else{
                odd+=i*i*i;
            }
        }
        cout<<even<<" "<<odd<<endl;
    }

}